.class public Lcom/philzhu/www/ddz/Keeper;
.super Ljava/lang/Object;
.source "Keeper.java"


# static fields
.field public static max:I

.field public static maxZha:I

.field public static playerDOutCards:Ljava/util/Vector;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Vector",
            "<",
            "Lcom/philzhu/www/ddz/Card;",
            ">;"
        }
    .end annotation
.end field

.field public static playerMOutCards:Ljava/util/Vector;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Vector",
            "<",
            "Lcom/philzhu/www/ddz/Card;",
            ">;"
        }
    .end annotation
.end field

.field public static playerUOutCards:Ljava/util/Vector;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Vector",
            "<",
            "Lcom/philzhu/www/ddz/Card;",
            ">;"
        }
    .end annotation
.end field

.field public static remainCards:Ljava/util/Vector;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Vector",
            "<",
            "Lcom/philzhu/www/ddz/Card;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method static constructor <clinit>()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 6
    const/4 v0, 0x0

    sput-object v0, Lcom/philzhu/www/ddz/Keeper;->remainCards:Ljava/util/Vector;

    .line 7
    new-instance v0, Ljava/util/Vector;

    invoke-direct {v0}, Ljava/util/Vector;-><init>()V

    sput-object v0, Lcom/philzhu/www/ddz/Keeper;->playerUOutCards:Ljava/util/Vector;

    .line 8
    new-instance v0, Ljava/util/Vector;

    invoke-direct {v0}, Ljava/util/Vector;-><init>()V

    sput-object v0, Lcom/philzhu/www/ddz/Keeper;->playerDOutCards:Ljava/util/Vector;

    .line 9
    new-instance v0, Ljava/util/Vector;

    invoke-direct {v0}, Ljava/util/Vector;-><init>()V

    sput-object v0, Lcom/philzhu/www/ddz/Keeper;->playerMOutCards:Ljava/util/Vector;

    .line 10
    sput v1, Lcom/philzhu/www/ddz/Keeper;->max:I

    .line 11
    sput v1, Lcom/philzhu/www/ddz/Keeper;->maxZha:I

    .line 5
    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 5
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method private static clearAllOutCards()V
    .locals 1

    .prologue
    .line 74
    sget-object v0, Lcom/philzhu/www/ddz/Keeper;->playerUOutCards:Ljava/util/Vector;

    invoke-virtual {v0}, Ljava/util/Vector;->removeAllElements()V

    .line 75
    sget-object v0, Lcom/philzhu/www/ddz/Keeper;->playerDOutCards:Ljava/util/Vector;

    invoke-virtual {v0}, Ljava/util/Vector;->removeAllElements()V

    .line 76
    sget-object v0, Lcom/philzhu/www/ddz/Keeper;->playerMOutCards:Ljava/util/Vector;

    invoke-virtual {v0}, Ljava/util/Vector;->removeAllElements()V

    .line 77
    return-void
.end method

.method public static getMax()I
    .locals 1

    .prologue
    .line 64
    sget v0, Lcom/philzhu/www/ddz/Keeper;->max:I

    return v0
.end method

.method public static getMaxZha()I
    .locals 1

    .prologue
    .line 69
    sget v0, Lcom/philzhu/www/ddz/Keeper;->maxZha:I

    return v0
.end method

.method public static init(Ljava/util/Vector;)V
    .locals 2
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Vector",
            "<",
            "Lcom/philzhu/www/ddz/Card;",
            ">;)V"
        }
    .end annotation

    .prologue
    .local p0, cards:Ljava/util/Vector;,"Ljava/util/Vector<Lcom/philzhu/www/ddz/Card;>;"
    const/16 v1, 0x11

    .line 15
    invoke-static {p0}, Lcom/philzhu/www/ddz/AI;->sortByBigOrSmall(Ljava/util/Vector;)Ljava/util/Vector;

    move-result-object v0

    sput-object v0, Lcom/philzhu/www/ddz/Keeper;->remainCards:Ljava/util/Vector;

    .line 16
    invoke-static {}, Lcom/philzhu/www/ddz/Keeper;->clearAllOutCards()V

    .line 17
    sput v1, Lcom/philzhu/www/ddz/Keeper;->max:I

    .line 18
    sput v1, Lcom/philzhu/www/ddz/Keeper;->maxZha:I

    .line 19
    return-void
.end method

.method public static remove(Lcom/philzhu/www/ddz/Player;Ljava/util/Vector;)V
    .locals 8
    .parameter "player"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/philzhu/www/ddz/Player;",
            "Ljava/util/Vector",
            "<",
            "Lcom/philzhu/www/ddz/Card;",
            ">;)V"
        }
    .end annotation

    .prologue
    .local p1, cardsAboutToRemove:Ljava/util/Vector;,"Ljava/util/Vector<Lcom/philzhu/www/ddz/Card;>;"
    const/4 v7, 0x0

    .line 23
    if-nez p1, :cond_0

    .line 60
    .end local p0
    :goto_0
    return-void

    .line 27
    .restart local p0
    :cond_0
    sget-object v3, Lcom/philzhu/www/ddz/Keeper;->remainCards:Ljava/util/Vector;

    invoke-static {v3, p1}, Lcom/philzhu/www/ddz/AI;->deleteCards(Ljava/util/Vector;Ljava/util/Vector;)Z

    .line 28
    invoke-virtual {p0}, Lcom/philzhu/www/ddz/Player;->getPlayerType()I

    move-result v1

    .line 29
    .local v1, playerType:I
    const/4 v3, 0x1

    if-ne v1, v3, :cond_2

    .line 31
    invoke-virtual {p1}, Ljava/util/Vector;->size()I

    move-result v2

    .line 32
    .local v2, size:I
    const/4 v0, 0x0

    .end local p0
    .local v0, i:I
    :goto_1
    if-lt v0, v2, :cond_1

    .line 36
    sget-object v3, Lcom/philzhu/www/ddz/Keeper;->playerMOutCards:Ljava/util/Vector;

    invoke-static {v3}, Lcom/philzhu/www/ddz/AI;->sortByBigOrSmall(Ljava/util/Vector;)Ljava/util/Vector;

    move-result-object v3

    sput-object v3, Lcom/philzhu/www/ddz/Keeper;->playerMOutCards:Ljava/util/Vector;

    .line 56
    :goto_2
    sget-object v3, Lcom/philzhu/www/ddz/Keeper;->remainCards:Ljava/util/Vector;

    invoke-static {v3}, Lcom/philzhu/www/ddz/AI;->sortByBigOrSmall(Ljava/util/Vector;)Ljava/util/Vector;

    move-result-object v3

    sput-object v3, Lcom/philzhu/www/ddz/Keeper;->remainCards:Ljava/util/Vector;

    .line 57
    sget-object v3, Lcom/philzhu/www/ddz/Keeper;->remainCards:Ljava/util/Vector;

    invoke-virtual {v3, v7}, Ljava/util/Vector;->elementAt(I)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Lcom/philzhu/www/ddz/Card;

    iget v3, p0, Lcom/philzhu/www/ddz/Card;->num:I

    sput v3, Lcom/philzhu/www/ddz/Keeper;->max:I

    .line 58
    sget-object v3, Lcom/philzhu/www/ddz/Keeper;->remainCards:Ljava/util/Vector;

    invoke-static {v3}, Lcom/philzhu/www/ddz/AI;->sortByFaceAndSuit(Ljava/util/Vector;)Ljava/util/Vector;

    move-result-object v3

    sput-object v3, Lcom/philzhu/www/ddz/Keeper;->remainCards:Ljava/util/Vector;

    .line 59
    sget-object v3, Lcom/philzhu/www/ddz/Keeper;->remainCards:Ljava/util/Vector;

    invoke-virtual {v3, v7}, Ljava/util/Vector;->elementAt(I)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Lcom/philzhu/www/ddz/Card;

    iget v3, p0, Lcom/philzhu/www/ddz/Card;->num:I

    sput v3, Lcom/philzhu/www/ddz/Keeper;->maxZha:I

    goto :goto_0

    .line 34
    :cond_1
    sget-object v3, Lcom/philzhu/www/ddz/Keeper;->playerMOutCards:Ljava/util/Vector;

    new-instance v4, Lcom/philzhu/www/ddz/Card;

    invoke-virtual {p1, v0}, Ljava/util/Vector;->elementAt(I)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Lcom/philzhu/www/ddz/Card;

    iget v5, p0, Lcom/philzhu/www/ddz/Card;->index:I

    invoke-virtual {p1, v0}, Ljava/util/Vector;->elementAt(I)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Lcom/philzhu/www/ddz/Card;

    iget v6, p0, Lcom/philzhu/www/ddz/Card;->suit:I

    invoke-direct {v4, v5, v6}, Lcom/philzhu/www/ddz/Card;-><init>(II)V

    invoke-virtual {v3, v4}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    .line 32
    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    .line 38
    .end local v0           #i:I
    .end local v2           #size:I
    .restart local p0
    :cond_2
    const/4 v3, 0x3

    if-ne v1, v3, :cond_4

    .line 40
    invoke-virtual {p1}, Ljava/util/Vector;->size()I

    move-result v2

    .line 41
    .restart local v2       #size:I
    const/4 v0, 0x0

    .end local p0
    .restart local v0       #i:I
    :goto_3
    if-lt v0, v2, :cond_3

    .line 45
    sget-object v3, Lcom/philzhu/www/ddz/Keeper;->playerDOutCards:Ljava/util/Vector;

    invoke-static {v3}, Lcom/philzhu/www/ddz/AI;->sortByBigOrSmall(Ljava/util/Vector;)Ljava/util/Vector;

    move-result-object v3

    sput-object v3, Lcom/philzhu/www/ddz/Keeper;->playerDOutCards:Ljava/util/Vector;

    goto :goto_2

    .line 43
    :cond_3
    sget-object v3, Lcom/philzhu/www/ddz/Keeper;->playerDOutCards:Ljava/util/Vector;

    new-instance v4, Lcom/philzhu/www/ddz/Card;

    invoke-virtual {p1, v0}, Ljava/util/Vector;->elementAt(I)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Lcom/philzhu/www/ddz/Card;

    iget v5, p0, Lcom/philzhu/www/ddz/Card;->index:I

    invoke-virtual {p1, v0}, Ljava/util/Vector;->elementAt(I)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Lcom/philzhu/www/ddz/Card;

    iget v6, p0, Lcom/philzhu/www/ddz/Card;->suit:I

    invoke-direct {v4, v5, v6}, Lcom/philzhu/www/ddz/Card;-><init>(II)V

    invoke-virtual {v3, v4}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    .line 41
    add-int/lit8 v0, v0, 0x1

    goto :goto_3

    .line 49
    .end local v0           #i:I
    .end local v2           #size:I
    .restart local p0
    :cond_4
    invoke-virtual {p1}, Ljava/util/Vector;->size()I

    move-result v2

    .line 50
    .restart local v2       #size:I
    const/4 v0, 0x0

    .end local p0
    .restart local v0       #i:I
    :goto_4
    if-lt v0, v2, :cond_5

    .line 54
    sget-object v3, Lcom/philzhu/www/ddz/Keeper;->playerUOutCards:Ljava/util/Vector;

    invoke-static {v3}, Lcom/philzhu/www/ddz/AI;->sortByBigOrSmall(Ljava/util/Vector;)Ljava/util/Vector;

    move-result-object v3

    sput-object v3, Lcom/philzhu/www/ddz/Keeper;->playerUOutCards:Ljava/util/Vector;

    goto/16 :goto_2

    .line 52
    :cond_5
    sget-object v3, Lcom/philzhu/www/ddz/Keeper;->playerUOutCards:Ljava/util/Vector;

    new-instance v4, Lcom/philzhu/www/ddz/Card;

    invoke-virtual {p1, v0}, Ljava/util/Vector;->elementAt(I)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Lcom/philzhu/www/ddz/Card;

    iget v5, p0, Lcom/philzhu/www/ddz/Card;->index:I

    invoke-virtual {p1, v0}, Ljava/util/Vector;->elementAt(I)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Lcom/philzhu/www/ddz/Card;

    iget v6, p0, Lcom/philzhu/www/ddz/Card;->suit:I

    invoke-direct {v4, v5, v6}, Lcom/philzhu/www/ddz/Card;-><init>(II)V

    invoke-virtual {v3, v4}, Ljava/util/Vector;->add(Ljava/lang/Object;)Z

    .line 50
    add-int/lit8 v0, v0, 0x1

    goto :goto_4
.end method
